<script type="text/javascript" language="javascript" charset="utf-8">
$(".menu-wrap li").removeClass("active-link");
$(".menu-wrap #teacher").addClass("active-link");
</script>
<div class="mask">
</div>
<div class="common-tit">
  <h2><%= @course.course_info.teacher.name %>-课表</h2>
  <span>导师课表 > 课表详情</span>
  <div class="cours-gbtn">
   <!--  <% if @course.course_info.appointmented_or_not %>
    <%= link_to "预约", appointment_admin_course_week_path(@course),remote: true %>
    <%end%> -->
  </div>
</div>
<div class="course-box">
  <h3>
    <span>基本信息</span>
  </h3>
  <ul class="cou-bas clearfix">
    <li>
      <span>销售类型:</span>
      <em><%= @course.course_info.sale_type %></em>
    </li>
    <li>
      <span>课程类型:</span>
      <em><%= @course.course_info.course_type %></em>
    </li>
    <li>
      <span>课程名称:</span>
      <em><%= @course.course_info.name %></em>
    </li>
    <li>
      <span>导师名称:</span>
      <em><%= @course.course_info.teacher.name %></em>
    </li>
    <li>
      <span>教室:</span>
      <em><%= @course.course_info.room.room_name %></em>
    </li>
    <li>
      <span>舞种:</span>
      <em><%= @course.course_info.dance_type %></em>
    </li>
    <li>
      <span>授课对象:</span>
      <em><%= @course.course_info.age_group %></em>
    </li>
    <li>
      <span>上课时长:</span>
      <em><%= @course.course_info.duration %>分钟</em>
    </li>
  </ul>
  <h3>
    <span>课程信息</span>
  </h3>
  <div class="course-b clearfix">
    <div class="class-itit">
      消费方式:
    </div>
    <div class="class-fcon">
      <% @course.course_info.paying_ways.each do |pw| %>
      <div>
        <%if pw.pay_type == "充值" %>
          <span><%= pw.pay_type %>:</span>
          <em><%= pw.amount %>元/课时</em>			
        <%elsif pw.pay_type == "次卡" %>
          <span><%= pw.pay_type %>:</span>
          <em><%= pw.amount %>次/课时</em>			
        <%else%>
          <em><%= pw.pay_type %></em>			
        <%end%>
      </div>
      <%end%>
    </div>
  </div>
  <div class="course-b clearfix">
    <div class="class-itit">
      预约信息:
    </div>
    <div class="class-fcon">
      <div>
        <em><%= @course.course_info.appointmented %></em>			
      </div>
    </div>
  </div>
  <div class="course-b clearfix">
    <div class="class-itit">
      课程时间:
    </div>
    <div class="class-fcon">
      <div>
        <em><%= @course.course_time.strftime("%Y-%m-%d %H:%M") %></em>			
      </div>
    </div>
  </div>
</div>
<div class="course-box">
  <h3>
    <i>记录信息</i>
  </h3>
  <div class="atten-co">
    <div class="atten-box">
      <div class="atten-sel">签到记录</div>
      <% if @course.course_info.appointmented_or_not %>
        <div>预约记录</div>
      <%end%>
    </div>
  </div>
  <div class="curli-box">
    <div class="curlist-con sel-curl">
      <div class="scrollbox">
        <table>
          <thead>
            <tr>
              <th class="week-t">签到时间</th>
              <th class="week-pos">学员</th>
              <th class="week-m">操作人</th>
            </tr>
          </thead>
          <tbody>
            <% @check_ins.each do |ci| %>
            <tr>
              <td>
                <span><%= ci.checked_at.strftime("%Y-%m-%d %H:%M") %></span>
              </td>
              <td><%= ci.student.name %></td>
              <td><%= ci.operator.name %></td>
            </tr>
            <% end %>
          </tbody>
        </table>
      </div>
    </div>
    <% if @course.course_info.appointmented_or_not %>
    <div class="curlist-con">
      <div class="scrollbox">
        <table>
          <thead>
            <tr>
              <th class="cou-t">操作时间</th>
              <th class="cou-stu">学员名</th>
              <th class="cou-cl">教室</th>
              <th class="cou-t">预约时间</th>
              <th class="cou-m">操作人</th>
              <th class="cou-ope">操作</th>
            </tr>
          </thead>
          <tbody>
            <% @appointment_records.each do |ar| %>
            <tr>
              <td>
                <span><%= ar.created_at.strftime("%Y-%m-%d %H:%M")%></span>
              </td>
              <td><%= ar.student.name %></td>
              <td><%= ar.course.course_info.room.room_name %></td>
              <td>
                <span><%= ar.appointment_at.strftime("%Y-%m-%d %H:%M") %></span>
              </td>
              <td><%= ar.operator.name %></td>
              <td class="cou-ope">
                <span><%= link_to "取消", destroy_appointment_record_admin_course_weeks_path(appointment_record_id: ar.id), remote: true, method: :delete, data: { confirm: 'Are you sure?' }%></span>
                </td>
            </tr>
            <% end %>
          </tbody>
        </table>
      </div>
    </div>
    <% end %>
  </div>
</div>
<script src="/assets/js/common.js"></script>
<script>
$(function(){
  $('.date-list1').date_input();
  $(".date-list2").date_input();
  $(".date-input").date_input();
});
$('.date-list2').on("click", function() {
  updateT1();
  $('.nav span').on("click", function() {
    if ($(this).parent().parent().parent().prev().attr("class") == "date-list2") {
      updateT1();
    };
  });
});
$('.date-list1').on("click", function() {
  updateT2();
  $('.nav span').on("click", function() {
    if ($(this).parent().parent().parent().prev().attr("class") == "date-list1") {
      updateT2();
    };
  });
});
$(".atten-box div").on("click", function() {
  $(".atten-box div").removeClass("atten-sel");
  $(this).addClass("atten-sel");
  if ($(this).index() == 0) {
    $(".curlist-con").eq(0).addClass("sel-curl").siblings().removeClass("sel-curl");
  } else if ($(this).index() == 1) {
    $(".curlist-con").eq(1).addClass("sel-curl").siblings().removeClass("sel-curl");
  } else {
    $(".curlist-con").eq(2).addClass("sel-curl").siblings().removeClass("sel-curl");
  }
})
</script>
